The flash memory is a very popular data storage apparatus at present. But the bit of the data may be erroneous caused by the problem of the occasional electrical noise or the random, non-repetitive erroneous occurrence of bit 0 or bit 1 stored in memory cell resulted from the limited access speed of flash memory due to the nature of its material. To ensure the correctness of the data stored in the logic memory cell, the error correcting code composed of bits is inserted into the data as a checking code for locating the error bit and correcting it. This data protecting scheme is called ECC checking.
Referring to FIG. 1A for the schematic view of the data structure of the flash memory in accordance with the conventional art, the flash memory 1 includes several blocks 11, and each block 11 includes several pages 12. Each page at least includes one sector 13, or mini-page, and each sector 13 at least includes a data area 131 and a spare area 132. Because the minimum transmission unit of the typical Integrated Device Electronic interface (IDE-ATA) is 512 bytes, the space of the storage area is generally 512 bytes and the space of the spare area is 16 bytes.
Referring to FIG. 1B for the schematic view of the data structure of the spare area 132 in accordance with the conventional art, the spare area 132 includes a bad memory information 141, an ECC checking information 142, a logic block address (LBA) information 143, a split block logic sector address (SBLSA) information 144, and a redundant code 145 of the ECC. The redundant code 145 is derived from the data encoded by using the ECC.
There are generally two types of ECC, which can be used as mentioned above: one is Block Code and the other is Convolution Code. The Block Code divides the data into several fixed blocks for transmission and its encoding methodology is by adding redundant code onto the original data. At the decoding end the error correction of the received data is performed based on the redundant code. The coding schemes most often used in block code are Reed-Solomon Code and Bose Chaudhuri Hocquengham code (BCH). The encoding/decoding of the Reed-Solomon Code is in a finite field (2m) where m is a positive integer. The finite field is also called Galois Field. The Reed-Solomon encoding/decoding technique is well known by the person in this field, and for the sake of brevity, detail discussion is omitted.
When in the flash memory data was encoded with the 4-bit ECC using the Reed-Solomon code derived from the Galois Field GF (210), to generate the redundant code, the space for storing the redundant code is 80 bits (10 bytes), i.e., 80=2×4×10. Therefore, as illustrated in spare area 132 of FIG. 1B, 10 bytes are reserved for redundant code 145 and the other 6 bytes are for other information, such as bad memory information 141. The storing space of the bad memory information 141, including bad block information and bad page information, is 1 byte. The bad block information is for indicating whether the block is damaged and the bad page information is for indicating whether the page is damaged. The storing space of the ECC checking information 142 is 1 byte for indicating whether the ECC checking should be executed. The storing space of the logic block address information 143 is 2 bytes, and the storing space of the split block logic sector address information 144 is 2 bytes.
As the data protection mechanism becomes more and more important, using more bits for error correcting encoding/decoding becomes a design trend of flash memory. However, When higher-bit schemes, e.g., the 6-bit ECC using the Reed-Solomon code derived from the Galois Field GF (210), are used to encode the data, the storing space required for the redundant code reaches 120 bit (or 15 byes), i.e., 120=2×6×10, and it becomes too much to be stored in the data structure illustrated in FIG. 1B. Although the manufacturer usually provides extra storing spaces in each flash memory based on the conventional data structure, but these extra storing spaces are fixed, limited and cannot be expanded. Therefore, what is needed is to dispose the data structure with higher space use efficiency in a limited space of the flash memory.
In the conventional art, the ECC checking information 142 is for indicating whether the current sector has been written or erased. However, the ECC checking information 142 needs an extra space, and the bit storing the ECC checking information 142 may be erroneous and results in erroneous judgment during decoding process. How to prevent the problem mentioned above becomes essential.